﻿using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace revitDemo
{
    public class 向量 : RevietBase
    {
        public 向量(ExternalCommandData commandData) : base(commandData)
        {
        }

        public override void Test()
        {


            OpenTransaction("向量", x =>
            {
                double length = 10;
                var line = Line.CreateBound(XYZ.Zero, new XYZ(0, length, 0));
                line.CreateModelCurve(x);

                var n = 2;


                for (int i = 0; i < 10; i++)
                {
                    double para = i * n / length;

                    // 轮廓平面法向量
                    var normal = line.Direction.Negate();
                    // XY平面转XZ平面
                    Transform transform = Transform.Identity;
                    transform.Origin = line.Evaluate(para, true);
                    transform.BasisX = XYZ.BasisX;
                    transform.BasisY = XYZ.BasisZ;
                    transform.BasisZ = normal;

                }




            });


           
           



        }
    }
}
